CFLAGS := -std=gnu2x -Wall -Wextra -Werror -Wfatal-errors -Wno-unused-function -Wno-ignored-qualifiers -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -O2

all: build/libminiutf8.so build/libminiutf8.a

build/utf8.o: utf8.c utf8.h Makefile
	@mkdir -p build
	gcc $(CFLAGS) $< -c -o $@

build/libminiutf8.a: build/utf8.o
	ar cr $@ $<
	ranlib $@

build/libminiutf8.so: build/utf8.o
	gcc -shared $< -o $@

clean:
	rm -rfv build
